﻿using System;
using System.Collections.Generic;
using System.Text;
using MSFraud_Q1_UnitTest;

namespace MSFraudExecDep {
    /// <summary>
    /// To run simple tests with console output.
    /// </summary>
    class Program {
        static void Main(string[] args) {
            TaskBase oneTask = new TaskBase(1, new int[] { 2, 3 });
            Console.WriteLine("Task: {0}", oneTask);

            TaskListReader reader = new TaskListReader(@"C:\a\j2010\Microsoft\MSFraud\MSFraud-ExecDepend-Q1\MSFraud-Q1-UnitTest\testData\depTreeD7.xml");
            TaskList tasks = reader.load();
            foreach (ITask task in tasks) {
                Console.WriteLine(task);
            }
            TaskDependencyOrderer orderer = new TaskDependencyOrderer();
            IList<ITask> ordered = orderer.GetExecutionOrder(tasks);
            Console.WriteLine("Ordered:");
            foreach (ITask task in ordered) {
                Console.WriteLine(task);
            }

        }
    }
}
